package lucene.server.web.model;

import lombok.Data;
import lucene.server.common.utils.DateUtils;

@Data
public class WSMessage {
    private boolean success = true;
    private String message;
    private String type;
    private Object  data;
    private String date = DateUtils.now() ;


    @Deprecated
    public static WSMessage OK() {
        WSMessage  r = new WSMessage();
        r.setSuccess(true);
        r.setMessage("成功");
        return r;
    }

    @Deprecated
    public static WSMessage OK(String msg) {
        WSMessage r = new WSMessage();
        r.setSuccess(true);
        r.setMessage(msg);
        return r;
    }

    @Deprecated
    public static WSMessage OK(Object data) {
        WSMessage r = new WSMessage();
        r.setSuccess(true);
        r.data =data ;
        return r;
    }

    @Deprecated
    public static WSMessage Error(String msg) {
        WSMessage r = new WSMessage();
        r.setSuccess(false);
        r.setMessage(msg);
        return r;
    }
}
